package com.project.server.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.project.server.dto.OrderRequest;
import com.project.server.model.Order;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface OrderService {

    /**
     * 创建订单
     */
    @Transactional
    void create(OrderRequest request, HttpServletRequest httpRequest);

    /**
     * 获取我的订单列表
     */
    List<Order> getMyOrders(HttpServletRequest request,Long status);

    /**
     * 获取订单详情
     */
    Order getById(Long id);

    /**
     * 取消订单
     */
    @Transactional
    void cancel(Long id, HttpServletRequest request);

    /**
     * 分页查询订单列表
     */
    Page<Order> page(Integer pageNum, Integer pageSize, Long restaurantId, Long userId, Integer status);

    /**
     * 确认订单
     */
    void confirm(Long id);

    /**
     * 完成订单
     */
    void complete(Long id);

}
